﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Surface;
using Microsoft.Surface.Presentation;
using Microsoft.Surface.Presentation.Controls;

namespace SurfaceApplication1
{
    public class WindowsView
    {
        public WindowsView(SurfaceWindow1 window)
        {
            //DrawingPadCanvas = window.InkCanvas177;
        }
        #region Fields
        SurfaceInkCanvas DrawingPadCanvas;
        #endregion

        #region Methods

        public void udpateDrawingPadCanvasColor(Color color)
        {
            
            // Black means the user touched the transparent part of the wheel. In that 
            // case, leave the color set to its current value
            if (color != Colors.Black)
            {
                DrawingPadCanvas.DefaultDrawingAttributes.Color = color;
                //  CurrentColor.Fill = new SolidColorBrush(color);
            }

            // Set editing mode to ink
            DrawingPadCanvas.EditingMode = SurfaceInkEditingMode.Ink;

            // Update the button image
            //EditModeButton.Content = DrawButtonImage;
        }

        public void updateDrawingPadCanvasEditMode(String mode)
        {
            if (mode.CompareTo("Edit")==0)
            {
                if (DrawingPadCanvas.EditingMode ==  SurfaceInkEditingMode.EraseByPoint)
                    DrawingPadCanvas.EditingMode = SurfaceInkEditingMode.Ink;
            }
            else if (mode.CompareTo("Erease") == 0)
            {
                if (DrawingPadCanvas.EditingMode == SurfaceInkEditingMode.Ink)
                    DrawingPadCanvas.EditingMode = SurfaceInkEditingMode.EraseByPoint;
            }
        }


        #endregion
    }
}
